$(function()
 {

	YuXi.InfoQuery.init({	
		url:"getUserInformation.do",
		query:{
				curFLow:1,
				currentPage:1
			},					
		success:function(data){					
				YuXi.Render.InformationSeach(data.list,1,"信息管理");//调用信息查询的页面渲染模块
			},
			getQueryParm:function(){
						var query={};
						query={
							curFLow:1,
							currentPage:1
						}
						YuXi.InfoQuery.queryData=YuXi.ALLSearch.base(query);
					},
				error:function(){},
				/* selector:{
					nextPage:$("#nextPage"),
					prevPage:$("#prevPage"),
					firstPage:$("#headPage"),
					lastPage:$("#endPage"),
					totalPage:$("#totalPage")
					此项为默认项
				}	 */
		});
		
	//跳转到详情界面
	$("#tablebody").parent().on("click", ".detail", function() {
			var id = $(this).attr("data-id");
			var menuId=$("#menu-container").attr("menu-id");		
			window.location.href = 'subDetailInfo.jsp?menuId='+menuId+'&detailId=' + id;
			/* location.search = "?detailId="+id;*/
		})
	//提交
	$("#tablebody").parent().on("click", ".submitInfo", function() {
			var id = $(this).attr("data-id");
			var menuId=$("#menu-container").attr("menu-id");		
			
			sub(id);
			
			/* location.search = "?detailId="+id;*/
	})
	function  sub(detailId)
	{
		var url="SubToFirstCheck.do";
		
				YuXi.util.get(url, {infoId: detailId}, function(data) {
					if(data.status){
						window.location.reload();
					}else{
						myTool.alert({		
							title:"提示",
							context:"提交信息失败！！！",
							isMask:true,
							callback:function(){
								

							}
						});
					}

				},function(){
					myTool.alert({		
						title:"提示",
						context:"发生未知错误！！！",
						isMask:true,
						callback:function(){
							

						}
					});
				});

	}
	//跳转到修改界面
	$("#tablebody").parent().on("click", ".update", function() {
		var id = $(this).attr("data-id");
		var flowId = $(this).attr("data-flowid");
		window.location.href = 'updateInfo.jsp?updateId=' + id + '&flowId=' + flowId;
	})
	


})